/**
 * 
 */
package com.cqan.account.rest;

import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;

import com.cqan.account.entity.resp.ResultResp;

/**
 * @Description 帐号REST服务层接口
 * @author slaton.wu@gmail.com
 * @date 2012-7-4下午6:15:57
 * 
 */
@Path("/account")
public interface AccountRestService {

	/**
	 * 用户登陆
	 * 
	 * @param username
	 * @param password
	 * @return
	 */
	@POST
	@Path("/login")
	public ResultResp login(@FormParam("username") String username,
			@FormParam("password") String password, @Context HttpHeaders headers);

	/**
	 * 用户注册接口
	 * 
	 * @param username
	 * @param password
	 * @return
	 */
	@POST
	@Path("/register")
	public ResultResp register(@FormParam("username") String username,
			@FormParam("password") String password, @Context HttpHeaders headers);

	/**
	 * 获取用户信息接口。需要验证token
	 * 
	 * @param id
	 * @return
	 */
	@GET
	@Path("/userInfo/{id}")
	public ResultResp getUserInfo(@PathParam("id") Long id,
			@Context HttpHeaders headers);

	/**
	 * 找回密码，只允许注册用户及手机绑定用户找回密码
	 * 
	 * @param headers
	 * @return
	 */
	@POST
	@Path("/findPwd")
	public ResultResp findPwd(@FormParam("username") String username,
			@Context HttpHeaders headers);

	/**
	 * 修改个人资料
	 * 
	 * @param nickname
	 *            用户昵称
	 * @param phone
	 *            电话
	 * @param realName
	 *            真实姓名
	 * @param address
	 *            地址
	 * @param headers
	 *            能用HEADER信息
	 * @return
	 */
	@POST
	@Path("/userModify")
	public ResultResp userModify(@FormParam("nickname") String nickname,
			@FormParam("phone") String phone,
			@FormParam("realName") String realName,
			@FormParam("address") String address,
			@FormParam("email") String email,
			@FormParam("birthday") String birthday,
			@FormParam("degree") String degree, @FormParam("sex") String sex,
			@FormParam("avatar") String avatar, @Context HttpHeaders headers);

	@POST
	@Path("/resetPwd")
	public ResultResp resetPwd(@FormParam("username") String username,
			@FormParam("password") String password,
			@FormParam("verifycode") String verifycode,
			@Context HttpHeaders headers);
}
